<div class="container">
    <h2>Admin Accounting</h2> 
     <div class="row">
	<div class="col-lg-12">
	<h3>Sold Items List</h3>
           <div class="table-responsive">
			<table class="table table-bordered table-hover table-striped">
				<thead>
					<tr>
				        <td><b>Transaction ID</b></td>
						<td><b>Date</b></td>
						<td><b>User ID</b></td>
						<td><b>Amount Paid</b></td>			
           			</tr>
           		</thead>
           <tbody>
            <?php
            $totalAmount = 0; 
            foreach ($transactions as $transaction) { 
            	$totalAmount += $transaction->amount;
            ?>
                <tr>
                    <td><?php if (isset($transaction->transaction_id)) echo htmlspecialchars($transaction->transaction_id, ENT_QUOTES, 'UTF-8'); ?></td>
					<td><?php if (isset($transaction->date)) echo htmlspecialchars($transaction->date, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($transaction->user_id)) echo htmlspecialchars($transaction->user_id, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($transaction->amount)) echo htmlspecialchars($transaction->amount, ENT_QUOTES, 'UTF-8'); ?></td>
			   </tr>
            <?php } ?>
            	<tr>
            		<td colspan="3" align="right"><b>Total Amount &nbsp;&nbsp;&nbsp;</b></td>
            		<td>
            			<?php print $totalAmount; ?></td>
            		</td>
            	</tr>
            </tbody>
          </table>
    </div>
	</div></div>
</div>
</div>
